import React, { useState } from 'react'
import { styles } from '../utils'


const MyUseState = () => {

  const [count, setCount] = useState(100)
  const [msg, setMsg] = useState('我宁愿留在你方圆几里')

  return (
    <div>
      <div style={styles.box}>
        <h3>UseState - 绑定数据并修改</h3>
        <hr />
        <h4>count = {count}</h4>
        <h4>msg = {msg}</h4>
        <hr />
        <button className='learn-more' onClick={() => setCount(count + 100)}>修改 count</button>
        <button className='learn-more' onClick={() => setMsg('我的心要不回就送你')}>修改 msg</button>
      </div>
    </div>
  )
}

export default MyUseState
